<div class="layui-fluid layui-anim website-anim" id="website-entrust-show" lay-title="委托课题列表">
    <div class="layui-row website-container">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body website-table-full">
                    <input type="hidden" id="planId_show" autocomplete="off" class="layui-input" data-th-value="${planId}"/>
                    <table lay-filter="showEntrustTable" lay-data="{id: 'showEntrustTable'}"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="toolbarSave">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="getCheckData">保存</button>
    </div>
</script>
<script type="text/html" id="entrust-class">
    {{#
    var dict=layui.dict.getByCode(d.subjectTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="entrust-district">
    {{#
    var dict=layui.dict.getByCode(d.districtTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="entrust-feature">
    {{#
    var dict=layui.dict.getByCode(d.featureTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="entrust-position">
    {{#
    var dict=layui.dict.getByCode(d.positionTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script type="text/html" id="entrust-title">
    {{#
    var dict=layui.dict.getByCode(d.titleTypeCode);
    }}
    {{#  if(dict){ }}
    <span>{{ dict.name }}</span>
    {{#  } }}
</script>
<script data-th-inline="none" type="text/javascript">
    layui.use(['dropdown', 'jquery', 'form', 'table', 'website','upload','dict'], function () {
        var $ = layui.jquery,
            website = layui.website,
            table = layui.table,
            dict = layui.dict,
            $view = $('#website-entrust-show'),tableIns;

        initTable();

        //头工具栏事件
        table.on('toolbar(showEntrustTable)', function(obj){
            var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
            switch(obj.event){
                case 'getCheckData':
                    var data = checkStatus.data;  //获取选中行数据
                    website.ajaxPost(ctx + 'reviews/' + $("#topicId").val() + '/classify', JSON.stringify(data), function () {
                        layer.closeAll();
                        website.alert.success('操作成功');
                    });
                    break;
            };
        });

        function initTable() {
            tableIns = website.table.init({
                elem: $view.find('table'),
                id: 'showEntrustTable',
                // toolbar: '#toolbarSave',
                url: ctx + 'declareTopic/' + $("#planId_show").val() + '/assignEntrusts',
                cols: [[
                    { type: 'numbers', title: '序号'},
                    {field: 'name', title: '课题名称', minWidth: 100},
                    {field: 'topicCode', title: '指南序号', minWidth: 100},
                    {field: 'conclusionTime',title: '申请时间', minWidth: 100},
                    {field: 'topicUnitName',title: '课题组织单位', minWidth: 100},
                    {field: 'initiatorName',title: '牵头人姓名', minWidth: 100},
                    {field: 'leaderName',title: '主持人姓名', minWidth: 100},
                    {field: 'mobile',title: '主持人手机', minWidth: 100},
                    {field: 'estimateTime',title: '拟结项时间', minWidth: 100},
                    {field: 'telephone', title: '联系电话', minWidth: 100}
                ]]
            });
        }
    })
</script>